//
//  HHPHomeService.m
//  HHPLiveVideo
//
//  Created by 韩红坡 on 2017/4/19.
//  Copyright © 2017年 韩红坡. All rights reserved.
//

#import "HHPHomeService.h"
#import "HHPHomeMacro.h"
#import "HHPADModel.h"
#import "HHPLiveModel.h"

@implementation HHPHomeService

- (HHPHTTPRequest *)fetchADData
{
    HHPHTTPRequest *request = [[HHPHTTPRequestManager manager] createRequest];
    
    request.method = HHPHTTPMethodGet;
    request.url = Home_GetAD;
    
    request.options.dataHandler = [HHPHTTPDataHandler dataHandlerWithType:HHPHTTPDataHandlerTypeArray modelClass:[HHPADModel class]];
    
    return request;
}

- (HHPHTTPRequest *)fetchRoomLiveDataWithPageNO:(NSString *)pageNO type:(RoomType)type
{
    HHPHTTPRequest *request = [[HHPHTTPRequestManager manager] createRequest];
    
    request.method = HHPHTTPMethodGet;
    request.url = Home_GetRoomLive;
    
    [request setParam:@"page" value:pageNO];
    [request setParam:@"type" value:[NSString stringWithFormat:@"%d", (int)type]];
    
    request.options.dataHandler = [HHPHTTPDataHandler dataHandlerWithType:HHPHTTPDataHandlerTypeArray modelClass:[HHPLiveModel class]];
    
    return request;
}

@end
